﻿{% extends "base/base.html" %}
{% load staticfiles %}

{% block customizedCSS %}
  <!-- this page specific styles -->
    <link rel="stylesheet" href="/static/css/compiled/personal-info.css" type="text/css" media="screen" />
{% endblock %}

{% block body %}
<!-- navbar -->
    <div class="navbar navbar-inverse">
        <div class="navbar-inner">
            <a class="brand" href="index.html"><img src="/static/img/logo.png" /></a>
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="nav-collapse collapse">
                <ul class="nav">
                    <li class="active"><a href="index.html">Home</a></li>
                    <li><a href="chart-showcase.html">Charts</a></li>
                    <li><a href="/customer/list/">客户</a></li>
                    <li><a href="form-showcase.html">Forms</a></li>
                    <li><a href="gallery.html">Gallery</a></li>
                    <li><a href="icons.html">Icons</a></li>
                    <li><a href="calendar.html">Calendar</a></li>
                    <li><a href="tables.html">Tables</a></li>
                    <li><a href="ui-elements.html">UI Elements</a></li>
                </ul>
            </div>
            <ul class="nav pull-right">
                <li class="hidden-phone">
                    <input class="search" type="text" />
                </li>
                <li class="settings">
                    <a href="personal-info.html" role="button">
                        <span class="navbar_icon"></span>
                    </a>
                </li>
                <li id="fat-menu" class="dropdown">
                    <a href="signin.html" role="button" class="logout">
                        <span class="navbar_icon"></span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <!-- end navbar -->
	<!-- main container .wide-content is used for this layout without sidebar :)  -->
    <div class="content wide-content">
        <div class="container-fluid">
            <div class="settings-wrapper" id="pad-wrapper">
                <!-- avatar column -->
                <div class="span3 avatar-box">
                    <div class="personal-image">
                        <img src="/static/img/contact-img.png" class="avatar img-circle" />
                        <p>Upload a different photo...</p>
                        
                        <input type="file" />
                    </div>
                </div>

                <!-- edit form column -->
                <div class="span7 personal-info">
                    <div class="alert alert-info">
                        <i class="icon-lightbulb"></i>
                        头像编辑功能暂时不提供开放，后续正在完善
                        <br /><strong>如有不便，望请谅解！</strong>
                    </div>
                    <h5 class="personal-title">客户信息编辑</h5>

                    <form action="/customer/new/" method="post">
                        <div class="field-box">
                            <label>客户名:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.account_name}}" />
                        </div>
                        <div class="field-box">
                            <label>客户类型:</label>
                            <div class="ui-select">
                                <select id="level" name="level" >
                                    <option value="1" />普通客户
                                    <option value="2" />长期客户
                                    <option value="3" />VIP客户
                                    <option value="4" />贵宾客户                                   
                                </select>
                            </div>
                        </div>
                        <div class="field-box">
                            <label>联系电话:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.phone}}" />
                        </div>
                        <div class="field-box">
                            <label>QQ:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.qq}}" />
                        </div>
                        <div class="field-box">
                            <label>QQ 昵称:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.qq_nickname}}" />
                        </div>
                        <div class="field-box">
                            <label>微信:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.weixin}}" />
                        </div>
                        <div class="field-box">
                            <label>微信昵称:</label>
                            <input class="span5 inline-input" type="text" value="{{cust.weixin_nickname}}" />
                        </div>
                        <div class="field-box">
                            <label>省份</label>
                            <div class="ui-select span3">
                                            <select id="province" name="province"></select>
                             </div>
                        </div>
                        <div class="field-box">
                            <label>城市</label>
                            <div class="ui-select span3">
                                            <select id="city" name="city"></select>
                            </div>
                        </div>
                        <div class="field-box">
                            <label>区县</label>
                           <div class="ui-select span3">
                                            <select id="area" name="area"></select>
                            </div>
                        </div>
                         <div class="field-box">
                              <label>街道</label>
                              <textarea class="span3" name="street">{{cust.street}}</textarea>             
                        </div>
                        
                        <div class="field-box">
                            <label>备注:</label>
                            <textarea class="span5" name="notes" rows="5" placeholder="最多允许100个字符">
                                {{item.notes}}
                            </textarea>
                        </div>
                        <div class="span6 field-box actions">
                            <input type="button" class="btn-glow primary" value="保存更改" />
                            <span>OR</span>
                            <input type="reset" value="取消" class="reset" />
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- end main container -->
{% endblock %}

 {% block customizedJS %}
    <script charset="utf-8" src="/static/js/PCASClass.js"></script>
    <script type="text/javascript">
    new PCAS("province","city","area",SPT,SCT,SAT) ;
         $("#province").val({{cust.province}});
        $("#city").val({{cust.city}});
        $("#area").val({{cust.area}});
    $(document).ready(function(){
        $("#level").val({{cust.level}});
       

    });     
    </script>
{% endblock %}